home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / jikes-1.02 / src / config.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-05  |  26.0 KB  |  477 lines

  1. // $Id: config.cpp,v 1.19 1999/08/26 15:34:06 shields Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1998, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10. #include "config.h"
  11. #include "long.h"
  12.  
  13. Ostream &Ostream::operator<<(LongInt a)
  14. {
  15.     char str[25];
  16.  
  17.     if (os -> flags() & os -> dec)
  18.          a.DecString(str);
  19.     else if (os -> flags() & os -> oct)
  20.          a.OctString(str, os -> flags() & os -> showbase);
  21.     else if (os -> flags() & os -> hex)
  22.          a.HexString(str, os -> flags() & os -> showbase);
  23.     else
  24.     {
  25.          os -> flush();
  26.          assert(! "know how to print signed long value in specified format yet !!!");
  27.     }
  28.  
  29.     *os << str;
  30.  
  31.     return *this;
  32. }
  33.  
  34. Ostream &Ostream::operator<<(ULongInt a)
  35. {
  36.     char str[25];
  37.  
  38.     if (os -> flags() & os -> dec)
  39.         a.DecString(str);
  40.     else if (os -> flags() & os -> oct)
  41.          a.OctString(str, os -> flags() & os -> showbase);
  42.     else if (os -> flags() & os -> hex)
  43.          a.HexString(str, os -> flags() & os -> showbase);
  44.     else
  45.     {
  46.          os -> flush();
  47.          assert(! "know how to print unsigned long value in specified format yet !!!");
  48.     }
  49.  
  50.     *os << str;
  51.  
  52.     return *this;
  53. }
  54.  
  55. wchar_t StringConstant::US_AND[]                        = {U_AM, U_NU}, // "&"
  56.         StringConstant::US_AND_AND[]                    = {U_AM, U_AM, U_NU}, // "&&"
  57.         StringConstant::US_AND_EQUAL[]                  = {U_AM, U_EQ, U_NU}, // "&="
  58.         StringConstant::US_COLON[]                      = {U_CO, U_NU}, // ":"
  59.         StringConstant::US_COMMA[]                      = {U_CM, U_NU}, // ","
  60.         StringConstant::US_DIVIDE[]                     = {U_SL, U_NU}, // "/"
  61.         StringConstant::US_DIVIDE_EQUAL[]               = {U_SL, U_EQ, U_NU}, // "/="
  62.         StringConstant::US_DOT[]                        = {U_DO, U_NU}, // "."
  63.         StringConstant::US_EMPTY[]                      = {U_NU}, // ""
  64.         StringConstant::US_EQUAL[]                      = {U_EQ, U_NU}, // "="
  65.         StringConstant::US_EQUAL_EQUAL[]                = {U_EQ, U_EQ, U_NU}, // "=="
  66.         StringConstant::US_GREATER[]                    = {U_GT, U_NU}, // ">"
  67.         StringConstant::US_GREATER_EQUAL[]              = {U_GT, U_EQ, U_NU}, // ">="
  68.         StringConstant::US_LBRACE[]                     = {U_OS, U_NU}, // "{"
  69.         StringConstant::US_LBRACKET[]                   = {U_LB, U_NU}, // "["
  70.         StringConstant::US_LEFT_SHIFT[]                 = {U_LT, U_LT, U_NU}, // "<<"
  71.         StringConstant::US_LEFT_SHIFT_EQUAL[]           = {U_LT, U_LT, U_EQ, U_NU}, // "<<="
  72.         StringConstant::US_LESS[]                       = {U_LT, U_NU}, // "<"
  73.         StringConstant::US_LESS_EQUAL[]                 = {U_LT, U_EQ, U_NU}, // "<="
  74.         StringConstant::US_LPAREN[]                     = {U_LP, U_NU}, // "("
  75.         StringConstant::US_MINUS[]                      = {U_MI, U_NU}, // "-"
  76.         StringConstant::US_MINUS_EQUAL[]                = {U_MI, U_EQ, U_NU}, // "-="
  77.         StringConstant::US_MINUS_MINUS[]                = {U_MI, U_MI, U_NU}, // "--"
  78.         StringConstant::US_MULTIPLY[]                   = {U_ST, U_NU}, // "*"
  79.         StringConstant::US_MULTIPLY_EQUAL[]             = {U_ST, U_EQ, U_NU}, // "*="
  80.         StringConstant::US_NOT[]                        = {U_EX, U_NU}, // "!"
  81.         StringConstant::US_NOT_EQUAL[]                  = {U_EX, U_EQ, U_NU}, // "!="
  82.         StringConstant::US_OR[]                         = {U_BA, U_NU}, // "|"
  83.         StringConstant::US_OR_EQUAL[]                   = {U_BA, U_EQ, U_NU}, // "|="
  84.         StringConstant::US_OR_OR[]                      = {U_BA, U_BA, U_NU}, // "||"
  85.         StringConstant::US_PLUS[]                       = {U_PL, U_NU}, // "+"
  86.         StringConstant::US_PLUS_EQUAL[]                 = {U_PL, U_EQ, U_NU}, // "+="
  87.         StringConstant::US_PLUS_PLUS[]                  = {U_PL, U_PL, U_NU}, // "++"
  88.         StringConstant::US_QUESTION[]                   = {U_QU, U_NU}, // "?"
  89.         StringConstant::US_RBRACE[]                     = {U_CS, U_NU}, // "}"
  90.         StringConstant::US_RBRACKET[]                   = {U_RB, U_NU}, // "]"
  91.         StringConstant::US_REMAINDER[]                  = {U_PE, U_NU}, // "%"
  92.         StringConstant::US_REMAINDER_EQUAL[]            = {U_PE, U_EQ, U_NU}, // "%="
  93.         StringConstant::US_RIGHT_SHIFT[]                = {U_GT, U_GT, U_NU}, // ">>"
  94.         StringConstant::US_RIGHT_SHIFT_EQUAL[]          = {U_GT, U_GT, U_EQ, U_NU}, // ">>="
  95.         StringConstant::US_RPAREN[]                     = {U_RP, U_NU}, // ")"
  96.         StringConstant::US_SEMICOLON[]                  = {U_SC, U_NU}, // ";"
  97.         StringConstant::US_TWIDDLE[]                    = {U_TI, U_NU}, // "~"
  98.         StringConstant::US_UNSIGNED_RIGHT_SHIFT[]       = {U_GT, U_GT, U_GT, U_NU}, // ">>>"
  99.         StringConstant::US_UNSIGNED_RIGHT_SHIFT_EQUAL[] = {U_GT, U_GT, U_GT, U_EQ, U_NU}, // ">>>="
  100.         StringConstant::US_XOR[]                        = {U_CA, U_NU}, // "^"
  101.         StringConstant::US_XOR_EQUAL[]                  = {U_CA, U_EQ, U_NU}, // "^="
  102.  
  103.         StringConstant::US_Boolean[] = {U_B, U_o, U_o, U_l, U_e, U_a, U_n, U_NU}, // "Boolean"
  104.         StringConstant::US_Byte[] = {U_B, U_y, U_t, U_e, U_NU}, // "Byte"
  105.         StringConstant::US_Character[] = {U_C, U_h, U_a, U_r, U_a, U_c, U_t, U_e, U_r, U_NU}, // "Character"
  106.         StringConstant::US_Class[] = {U_C, U_l, U_a, U_s, U_s, U_NU}, // "Class"
  107.         StringConstant::US_ClassNotFoundException[] = {U_C, U_l, U_a, U_s, U_s, U_N, U_o, U_t, U_F, U_o, U_u, U_n, U_d, U_E, U_x, U_c, U_e, U_p, U_t, U_i, U_o, U_n, U_NU}, // "ClassNotFoundException"
  108.         StringConstant::US_Cloneable[] = {U_C, U_l, U_o, U_n, U_e, U_a, U_b, U_l, U_e, U_NU}, // "Cloneable"
  109.         StringConstant::US_Double[] = {U_D, U_o, U_u, U_b, U_l, U_e, U_NU}, // "Double"
  110.         StringConstant::US_Error[] = {U_E, U_r, U_r, U_o, U_r, U_NU}, // "Error"
  111.         StringConstant::US_Float[] = {U_F, U_l, U_o, U_a, U_t, U_NU},  // "Float"
  112.         StringConstant::US_Integer[] = {U_I, U_n, U_t, U_e, U_g, U_e, U_r, U_NU}, // "Integer"
  113.         StringConstant::US_L[] = {U_L, U_NU}, // "L"
  114.         StringConstant::US_Long[]  = {U_L, U_o, U_n, U_g, U_NU}, // "Long"
  115.         StringConstant::US_NoClassDefFoundError[] = {U_N, U_o, U_C, U_l, U_a, U_s, U_s, U_D, U_e, U_f, U_F, U_o, U_u, U_n, U_d, U_E, U_r, U_r, U_o, U_r, U_NU}, // "NoClassDefFoundError"
  116.         StringConstant::US_Object[] = {U_O, U_b, U_j, U_e, U_c, U_t, U_NU}, // "Object"
  117.         StringConstant::US_PObject[] = {U_P, U_O, U_b, U_j, U_e, U_c, U_t, U_NU}, // "PObject"
  118.         StringConstant::US_RuntimeException[] = {U_R, U_u, U_n, U_t, U_i, U_m, U_e, U_E, U_x, U_c, U_e, U_p, U_t, U_i, U_o, U_n, U_NU}, // RuntimeException
  119.         StringConstant::US_Serializable[] = {U_S, U_e, U_r, U_i, U_a, U_l, U_i, U_z, U_a, U_b, U_l, U_e, U_NU}, // Serializable
  120.         StringConstant::US_Short[] = {U_S, U_h, U_o, U_r, U_t, U_NU}, // Short
  121.         StringConstant::US_StringBuffer[] = {U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_NU}, // StringBuffer
  122.         StringConstant::US_String[] = {U_S, U_t, U_r, U_i, U_n, U_g, U_NU}, // String
  123.         StringConstant::US_TYPE[] = {U_T, U_Y, U_P, U_E, U_NU}, // "TYPE"
  124.         StringConstant::US_Throwable[] = {U_T, U_h, U_r, U_o, U_w, U_a, U_b, U_l, U_e, U_NU}, // Throwable
  125.         StringConstant::US_Void[] = {U_V, U_o, U_i, U_d, U_NU}, // Void
  126.         StringConstant::US__DO[] = {U_DO, U_NU}, // "."
  127.         StringConstant::US__DO__DO[] = {U_DO, U_DO, U_NU}, // ".."
  128.         StringConstant::US__DS[] = {U_DS, U_NU}, // "$"
  129.         StringConstant::US__LB__RB[] = {U_LB, U_RB, U_NU}, // "[]"
  130.         StringConstant::US__LT_clinit_GT[] = {U_LT, U_c, U_l, U_i, U_n, U_i, U_t, U_GT, U_NU}, // "<clinit>"
  131.         StringConstant::US__LT_init_GT[] = {U_LT, U_i, U_n, U_i, U_t, U_GT, U_NU}, // "<init>"
  132.         StringConstant::US__QU__QU[] = {U_QU, U_QU, U_NU},  // "??"
  133.         StringConstant::US__SC[] = {U_SC, U_NU}, // ";"
  134.         StringConstant::US__SL[] = {U_SL, U_NU}, // "/"
  135.  
  136.         StringConstant::US__zip[] = {U_z, U_i, U_p, U_NU}, // "zip"
  137.         StringConstant::US__jar[] = {U_j, U_a, U_r, U_NU}, // "jar"
  138.  
  139.         StringConstant::US__array[] = {U_a, U_r, U_r, U_a, U_y, U_NU}, // "array"
  140.         StringConstant::US__access_DOLLAR[] = {U_a, U_c, U_c, U_e, U_s, U_s, U_DS, U_NU}, // "access$"
  141.         StringConstant::US__class_DOLLAR[] = {U_c, U_l, U_a, U_s, U_s, U_DS, U_NU}, // "class$"
  142.         StringConstant::US__constructor_DOLLAR[] = {U_c, U_o, U_n, U_s, U_t, U_r, U_u, U_c, U_t, U_o, U_r, U_DS, U_NU}, // "constructor$"
  143.         StringConstant::US__this_DOLLAR[] = {U_t, U_h, U_i, U_s, U_DS, U_NU}, // "this$"
  144.         StringConstant::US__val_DOLLAR[] = {U_v, U_a, U_l, U_DS, U_NU}, // "val$"
  145.  
  146.         StringConstant::US_abstract[] = {U_a, U_b, U_s, U_t, U_r, U_a, U_c, U_t, U_NU}, // "abstract"
  147.         StringConstant::US_append[] = {U_a, U_p, U_p, U_e, U_n, U_d, U_NU}, // "append"
  148.         StringConstant::US_block_DOLLAR[] = {U_b, U_l, U_o, U_c, U_k, U_DS, U_NU}, // "block$"
  149.         StringConstant::US_boolean[] = {U_b, U_o, U_o, U_l, U_e, U_a, U_n, U_NU}, // "boolean"
  150.         StringConstant::US_break[] = {U_b, U_r, U_e, U_a, U_k, U_NU}, // "break"
  151.         StringConstant::US_byte[] = {U_b, U_y, U_t, U_e, U_NU}, // "byte"
  152.         StringConstant::US_case[] = {U_c, U_a, U_s, U_e, U_NU}, // "case"
  153.         StringConstant::US_catch[] = {U_c, U_a, U_t, U_c, U_h, U_NU}, // "catch"
  154.         StringConstant::US_char[] = {U_c, U_h, U_a, U_r, U_NU}, // "char"
  155.         StringConstant::US_class[] = {U_c, U_l, U_a, U_s, U_s, U_NU}, // "class"
  156.         StringConstant::US_clone[] = {U_c, U_l, U_o, U_n, U_e, U_NU}, // "clone"
  157.         StringConstant::US_const[] = {U_c, U_o, U_n, U_s, U_t, U_NU}, // "const"
  158.         StringConstant::US_continue[] = {U_c, U_o, U_n, U_t, U_i, U_n, U_u, U_e, U_NU}, // "continue"
  159.         StringConstant::US_default[] = {U_d, U_e, U_f, U_a, U_u, U_l, U_t, U_NU}, // "default"
  160.         StringConstant::US_do[] = {U_d, U_o, U_NU}, // "do"
  161.         StringConstant::US_double[] = {U_d, U_o, U_u, U_b, U_l, U_e, U_NU}, // "double"
  162.         StringConstant::US_else[] = {U_e, U_l, U_s, U_e, U_NU}, // "else"
  163.         StringConstant::US_extends[] = {U_e, U_x, U_t, U_e, U_n, U_d, U_s, U_NU}, // "extends"
  164.         StringConstant::US_false[] = {U_f, U_a, U_l, U_s, U_e, U_NU}, // "false"
  165.         StringConstant::US_final[] = {U_f, U_i, U_n, U_a, U_l, U_NU}, // "final"
  166.         StringConstant::US_finally[] = {U_f, U_i, U_n, U_a, U_l, U_l, U_y, U_NU}, // "finally"
  167.         StringConstant::US_float[] = {U_f, U_l, U_o, U_a, U_t, U_NU}, // "float"
  168.         StringConstant::US_for[] = {U_f, U_o, U_r, U_NU}, // "for"
  169.         StringConstant::US_forName[] = {U_f, U_o, U_r, U_N, U_a, U_m, U_e, U_NU}, // "forName"
  170.         StringConstant::US_getMessage[] = {U_g, U_e, U_t, U_M, U_e, U_s, U_s, U_a, U_g, U_e, U_NU}, // "getMessage"
  171.         StringConstant::US_goto[] = {U_g, U_o, U_t, U_o, U_NU}, // "goto"
  172.         StringConstant::US_if[] = {U_i, U_f, U_NU}, // "if"
  173.         StringConstant::US_implements[] = {U_i, U_m, U_p, U_l, U_e, U_m, U_e, U_n, U_t, U_s, U_NU}, // "implements"
  174.         StringConstant::US_import[] = {U_i, U_m, U_p, U_o, U_r, U_t, U_NU}, // "import"
  175.         StringConstant::US_instanceof[] = {U_i, U_n, U_s, U_t, U_a, U_n, U_c, U_e, U_o, U_f, U_NU}, // "instanceof"
  176.         StringConstant::US_int[] = {U_i, U_n, U_t, U_NU}, // "int"
  177.         StringConstant::US_interface[] = {U_i, U_n, U_t, U_e, U_r, U_f, U_a, U_c, U_e, U_NU}, // "interface"
  178.         StringConstant::US_java_SL_io[] =  {U_j, U_a, U_v, U_a, U_SL, U_i, U_o, U_NU}, // "java/io"
  179.         StringConstant::US_java_SL_lang[] = {U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_NU}, // "java/lang"
  180.         StringConstant::US_length[] = {U_l, U_e, U_n, U_g, U_t, U_h, U_NU}, // "length"
  181.         StringConstant::US_long[] = {U_l, U_o, U_n, U_g, U_NU}, // "long"
  182.         StringConstant::US_native[] = {U_n, U_a, U_t, U_i, U_v, U_e, U_NU}, // "native"
  183.         StringConstant::US_new[] = {U_n, U_e, U_w, U_NU}, // "new"
  184.         StringConstant::US_null[] = {U_n, U_u, U_l, U_l, U_NU}, // "null"
  185.         StringConstant::US_package[] = {U_p, U_a, U_c, U_k, U_a, U_g, U_e, U_NU}, // "package"
  186.         StringConstant::US_private[] = {U_p, U_r, U_i, U_v, U_a, U_t, U_e, U_NU}, // "private"
  187.         StringConstant::US_protected[] = {U_p, U_r, U_o, U_t, U_e, U_c, U_t, U_e, U_d, U_NU}, // "protected"
  188.         StringConstant::US_public[] = {U_p, U_u, U_b, U_l, U_i, U_c, U_NU}, // "public"
  189.         StringConstant::US_return[] = {U_r, U_e, U_t, U_u, U_r, U_n, U_NU}, // "return"
  190.         StringConstant::US_short[] = {U_s, U_h, U_o, U_r, U_t, U_NU}, // "short"
  191.         StringConstant::US_static[] = {U_s, U_t, U_a, U_t, U_i, U_c, U_NU}, // "static"
  192.         StringConstant::US_strictfp[] = {U_s, U_t, U_r, U_i, U_c, U_t, U_f, U_p, U_NU}, // "strictfp"
  193.         StringConstant::US_super[] = {U_s, U_u, U_p, U_e, U_r, U_NU}, // "super"
  194.         StringConstant::US_switch[] = {U_s, U_w, U_i, U_t, U_c, U_h, U_NU}, // "switch"
  195.         StringConstant::US_synchronized[] = {U_s, U_y, U_n, U_c, U_h, U_r, U_o, U_n, U_i, U_z, U_e, U_d, U_NU}, // "synchronized"
  196.         StringConstant::US_this0[] = {U_t, U_h, U_i, U_s, U_DS, U_0, U_NU}, // "this$0"
  197.         StringConstant::US_this[] = {U_t, U_h, U_i, U_s, U_NU}, // "this"
  198.         StringConstant::US_throw[] = {U_t, U_h, U_r, U_o, U_w, U_NU}, // "throw"
  199.         StringConstant::US_throws[] = {U_t, U_h, U_r, U_o, U_w, U_s, U_NU}, // "throws"
  200.         StringConstant::US_toString[] = {U_t, U_o, U_S, U_t, U_r, U_i, U_n, U_g, U_NU}, // "toString"
  201.         StringConstant::US_transient[] = {U_t, U_r, U_a, U_n, U_s, U_i, U_e, U_n, U_t, U_NU}, // "transient"
  202.         StringConstant::US_true[] = {U_t, U_r, U_u, U_e, U_NU}, // "true"
  203.         StringConstant::US_try[] = {U_t, U_r, U_y, U_NU}, // "try"
  204.         StringConstant::US_void[] = {U_v, U_o, U_i, U_d, U_NU}, // "void"
  205.         StringConstant::US_volatile[] = {U_v, U_o, U_l, U_a, U_t, U_i, U_l, U_e, U_NU}, // "volatile"
  206.         StringConstant::US_while[] = {U_w, U_h, U_i, U_l, U_e, U_NU}, // "while"
  207.  
  208.         StringConstant::US_EOF[] = {U_E, U_O, U_F, U_NU}; // "EOF"
  209.  
  210. wchar_t StringConstant::US_smallest_int[] = {U_MINUS, U_2, U_1, U_4, U_7, U_4, U_8, U_3, U_6, U_4, U_8, U_NU}; // "-2147483648"
  211.  
  212. char StringConstant::U8S_command_format[] = "use: jikes [-classpath path][-d dir][-debug][-depend][-deprecation]"
  213.                                             "[-g][-nowarn][-nowrite][-O][-verbose][-Xstdout]"
  214.                                             "[+1.0][++][+B][+D][+E][+F][+K][+M][+P][+T][+U][+Z]"
  215.                                             " file.java...";
  216.  
  217. char StringConstant::U8S_B[] = {U_B,U_NU}, // "B"
  218.      StringConstant::U8S_C[] = {U_C,U_NU}, // "C"
  219.      StringConstant::U8S_Code[] = {U_C,U_o,U_d,U_e,U_NU}, // "Code"
  220.      StringConstant::U8S_ConstantValue[] = {U_C,U_o,U_n,U_s,U_t,U_a,U_n,U_t,U_V,U_a,U_l,U_u,U_e,U_NU}, // "ConstantValue"
  221.      StringConstant::U8S_D[] = {U_D,U_NU}, // "D"
  222.      StringConstant::U8S_Exceptions[] = {U_E,U_x,U_c,U_e,U_p,U_t,U_i,U_o,U_n,U_s,U_NU}, // "Exceptions"
  223.      StringConstant::U8S_F[] = {U_F,U_NU}, // "F"
  224.      StringConstant::U8S_I[] = {U_I,U_NU}, // "I"
  225.      StringConstant::U8S_InnerClasses[] = {U_I,U_n,U_n,U_e,U_r,U_C,U_l,U_a,U_s,U_s,U_e,U_s,U_NU}, // "InnerClasses"
  226.      StringConstant::U8S_J[] = {U_J,U_NU},  // "J"
  227.      StringConstant::U8S_LP_Ljava_SL_lang_SL_String_SC_RP_Ljava_SL_lang_SL_Class_SC[] = {U_LP,U_L,U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_S,U_t,U_r,U_i,U_n,U_g,U_SC,U_RP,U_L,U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_C,U_l,U_a,U_s,U_s,U_SC,U_NU}, // "(Ljava/lang/String;)Ljava/lang/Class;"
  228.      StringConstant::U8S_LP_Ljava_SL_lang_SL_String_SC_RP_V[] = {U_LP,U_L,U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_S,U_t,U_r,U_i,U_n,U_g,U_SC,U_RP,U_V,U_NU}, // "(Ljava/lang/String;)V"
  229.      StringConstant::U8S_LP_RP_Ljava_SL_lang_SL_String_SC[] = {U_LP,U_RP,U_L,U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_S,U_t,U_r,U_i,U_n,U_g,U_SC,U_NU}, // "()_Ljava/lang/String;"
  230.      StringConstant::U8S_LP_RP_V[] = {U_LP,U_RP,U_V,U_NU}, // "()V"
  231.      StringConstant::U8S_LineNumberTable[] = {U_L,U_i,U_n,U_e,U_N,U_u,U_m,U_b,U_e,U_r,U_T,U_a,U_b,U_l,U_e,U_NU}, // "LineNumberTable"
  232.      StringConstant::U8S_LocalVariableTable[] = {U_L,U_o,U_c,U_a,U_l,U_V,U_a,U_r,U_i,U_a,U_b,U_l,U_e,U_T,U_a,U_b,U_l,U_e,U_NU}, // "LocalVariableTable"
  233.      StringConstant::U8S_S[] = {U_S,U_NU}, // "S"
  234.      StringConstant::U8S_Sourcefile[] = {U_S,U_o,U_u,U_r,U_c,U_e,U_F,U_i,U_l,U_e,U_NU}, // "Sourcefile"
  235.      StringConstant::U8S_Synthetic[] = {U_S,U_y,U_n,U_t,U_h,U_e,U_t,U_i,U_c,U_NU}, // "Synthetic"
  236.      StringConstant::U8S_Deprecated[] = {U_D,U_e,U_p,U_r,U_e,U_c,U_a,U_t,U_e,U_d,U_NU}, // "Deprecated"
  237.      StringConstant::U8S_V[] = {U_V,U_NU}, // "V"
  238.      StringConstant::U8S_Z[] = {U_Z,U_NU}, // "Z"
  239.  
  240.      StringConstant::U8S__DO[] = {U_DO,U_NU}, // "."
  241.      StringConstant::U8S__DO_class[] = {U_DO,U_c,U_l,U_a,U_s,U_s,U_NU}, // ".class"
  242.      StringConstant::U8S__DO_java[] = {U_DO,U_j,U_a,U_v,U_a,U_NU}, // ".java"
  243.      StringConstant::U8S__DO_tok[] = {U_DO,U_t,U_o,U_k,U_NU}, // ".tok"
  244.      StringConstant::U8S__DO_u[] = {U_DO,U_u,U_NU}, // ".u"
  245.      StringConstant::U8S__LP[] = {U_LP,U_NU}, // "("
  246.      StringConstant::U8S__RP[] = {U_RP,U_NU}, // ")"
  247.      StringConstant::U8S__SL[] = {U_SL,U_NU}, // "/"
  248.      StringConstant::U8S__ST[] = {U_ST,U_NU}, // "*"
  249.  
  250.      StringConstant::U8S_class[] = {U_c,U_l,U_a,U_s,U_s,U_NU}, // "class"
  251.      StringConstant::U8S_java[] = {U_j,U_a,U_v,U_a,U_NU}, // "java"
  252.      StringConstant::U8S_java_SL_lang_SL_ClassNotFoundException[] = {U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_C,U_l,U_a,U_s,U_s,U_N,U_o,U_t,U_F,U_o,U_u,U_n,U_d,U_E,U_x,U_c,U_e,U_p,U_t,U_i,U_o,U_n,U_NU}, // "java/lang/ClassNotFoundException"
  253.      StringConstant::U8S_java_SL_lang_SL_Class[] = {U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_C,U_l,U_a,U_s,U_s,U_NU}, // "java/lang/Class"
  254.      StringConstant::U8S_java_SL_lang_SL_InternalError[] = {U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_I,U_n,U_t,U_e,U_r,U_n,U_a,U_l,U_E,U_r,U_r,U_o,U_r,U_NU}, // "java/lang/InternalError"
  255.      StringConstant::U8S_java_SL_lang_SL_NoClassDefFoundError[] = {U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_N,U_o,U_C,U_l,U_a,U_s,U_s,U_D,U_e,U_f,U_F,U_o,U_u,U_n,U_d,U_E,U_r,U_r,U_o,U_r,U_NU}, // "java/lang/NoClassDefFoundError"
  256.      StringConstant::U8S_java_SL_lang_SL_StringBuffer[] = {U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_S,U_t,U_r,U_i,U_n,U_g,U_B,U_u,U_f,U_f,U_e,U_r,U_NU}, // "java/lang/StringBuffer"
  257.      StringConstant::U8S_java_SL_lang_SL_Throwable[] = {U_j,U_a,U_v,U_a,U_SL,U_l,U_a,U_n,U_g,U_SL,U_T,U_h,U_r,U_o,U_w,U_a,U_b,U_l,U_e,U_NU}, // "java/lang/Throwable"
  258.      StringConstant::U8S_null[] = {U_n,U_u,U_l,U_l,U_NU}, // "null"
  259.      StringConstant::U8S_quit[] = {U_q,U_u,U_i,U_t,U_NU}, // "quit"
  260.      StringConstant::U8S_this[] = {U_t,U_h,U_i,U_s,U_NU}, // "this"
  261.  
  262.      StringConstant::U8S_LP_LB_C_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_LB, U_C, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  263.      StringConstant::U8S_LP_C_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_C, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  264.      StringConstant::U8S_LP_Z_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_Z, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  265.      StringConstant::U8S_LP_I_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_I, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  266.      StringConstant::U8S_LP_J_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_J, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  267.      StringConstant::U8S_LP_F_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_F, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  268.      StringConstant::U8S_LP_D_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_D, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  269.      StringConstant::U8S_LP_Ljava_SL_lang_SL_String_SC_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_SC, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU},
  270.      StringConstant::U8S_LP_Ljava_SL_lang_SL_Object_SC_RP_Ljava_SL_lang_SL_StringBuffer_SC[] = {U_LP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_O, U_b, U_j, U_e, U_c, U_t, U_SC, U_RP, U_L, U_j, U_a, U_v, U_a, U_SL, U_l, U_a, U_n, U_g, U_SL, U_S, U_t, U_r, U_i, U_n, U_g, U_B, U_u, U_f, U_f, U_e, U_r, U_SC, U_NU};
  271.  
  272. char StringConstant::U8S_smallest_int[] = {U_MINUS, U_2, U_1, U_4, U_7, U_4, U_8, U_3, U_6, U_4, U_8, U_NU}; // "-2147483648"
  273.  
  274. int StringConstant::U8S_ConstantValue_length = strlen(U8S_ConstantValue),
  275.     StringConstant::U8S_Exceptions_length = strlen(U8S_Exceptions),
  276.     StringConstant::U8S_InnerClasses_length = strlen(U8S_InnerClasses),
  277.     StringConstant::U8S_Synthetic_length = strlen(U8S_Synthetic),
  278.     StringConstant::U8S_Deprecated_length = strlen(U8S_Deprecated),
  279.     StringConstant::U8S_LineNumberTable_length = strlen(U8S_LineNumberTable),
  280.     StringConstant::U8S_LocalVariableTable_length = strlen(U8S_LocalVariableTable),
  281.     StringConstant::U8S_Code_length = strlen(U8S_Code),
  282.     StringConstant::U8S_Sourcefile_length = strlen(U8S_Sourcefile),
  283.  
  284.     StringConstant::U8S_null_length = strlen(U8S_null),
  285.     StringConstant::U8S_this_length = strlen(U8S_this);
  286.  
  287. //
  288. // If the system runs out of memory, this function is invoked
  289. //
  290. #ifdef MICROSOFT
  291.     int OutOfMemory(size_t)
  292.     {
  293.         fprintf(stderr, "***System Failure: Out of memory\n");
  294.         exit(1);
  295.  
  296.         return 0;
  297.     }
  298.  
  299.     void SetNewHandler()
  300.     {
  301.         _set_new_handler(OutOfMemory);
  302.     }
  303. #else
  304.     void OutOfMemory()
  305.     {
  306.         fprintf(stderr, "***System Failure: Out of memory\n");
  307.         exit(1);
  308.     }
  309.  
  310.     void SetNewHandler()
  311.     {
  312.         set_new_handler(OutOfMemory);
  313.     }
  314. #endif
  315.  
  316. //
  317. // When using the ICC compiler on Win95 or OS/2, we need to disable
  318. // testing for various floating point exceptions. Default behavior
  319. // was causing problems reading some standard class files.
  320. //
  321. #ifdef ICC
  322. #include <float.h>
  323.     void FloatingPointCheck()
  324.     {
  325.         _control87(EM_UNDERFLOW, EM_UNDERFLOW);
  326.         _control87(EM_ZERODIVIDE, EM_ZERODIVIDE);
  327.         _control87(EM_OVERFLOW, EM_OVERFLOW);
  328.         _control87(EM_INVALID, EM_INVALID);
  329.  
  330.         return;
  331.     }
  332. #else
  333.     void FloatingPointCheck() {}
  334. #endif
  335.  
  336. #ifdef EBCDIC
  337. //
  338. // variants of system functions requiring EBCDIC translation
  339. // are declared here and defined in code.cpp
  340. //
  341.     int SystemStat(const char *name, struct stat *stat_struct) { /* TODO: */ return 0; }
  342.     FILE *SystemFopen(char *name, char *mode) { /* TODO: */ return NULL; }
  343.     size_t SystemFread(char *ptr, size_t element_size, size_t count, FILE *stream,int ascii_option) { /* TODO: */ return 0; }
  344.     int SystemIsDirectory(char *name) { /* TODO: */ return 0; }
  345. #else
  346.     int SystemStat(const char *name, struct stat *stat_struct)
  347.     {
  348.         return stat(name, stat_struct);
  349.     }
  350.     FILE *SystemFopen(char *name, char *mode)
  351.     {
  352.         return fopen(name, mode);
  353.     }
  354.     size_t SystemFread(char *ptr, size_t element_size, size_t count, FILE *stream, int ascii_option)
  355.     {
  356.         return fread(ptr, element_size, count, stream);
  357.     }
  358.     int SystemIsDirectory(char *name)
  359.     {
  360.         struct stat status;
  361.         return (((::SystemStat(name, &status) == 0) && (status.st_mode & STAT_S_IFDIR)) ? 1 : 0);
  362.     }
  363. #endif
  364.  
  365.  
  366. #if defined(GNU_LIBC5) || defined __amigaos__
  367. #include <sys/stat.h>
  368. #ifndef UNIX
  369.     int SystemMkdir(char *dirname)
  370.     {
  371.         return mkdir(dirname, S_IRWXU);
  372.     }
  373. #endif
  374.     size_t wcslen(wchar_t *cs)
  375.     {
  376.         int n = 0;
  377.         while (*cs++)
  378.             n++;
  379.  
  380.         return n;
  381.     }
  382.  
  383.     wchar_t *wcscpy(wchar_t *s, wchar_t *ct)
  384.     {
  385.         wchar_t *ptr;
  386.         for (ptr = s; *ct; ptr++, ct++)
  387.             *ptr = *ct;
  388.         *ptr = U_NULL;
  389.  
  390.         return s;
  391.     }
  392.  
  393.     wchar_t *wcsncpy(wchar_t *s, wchar_t *ct, int n)
  394.     {
  395.         wchar_t *ptr;
  396.         for (ptr = s; *ct && n-- > 0; ptr++, ct++)
  397.             *ptr = *ct;
  398.         while (n-- > 0)
  399.             *ptr++ = U_NULL;
  400.  
  401.         return s;
  402.     }
  403.  
  404.     wchar_t *wcscat(wchar_t *s, wchar_t *ct)
  405.     {
  406.         wchar_t *ptr = s;
  407.  
  408.         while (*ptr)
  409.             ptr++;
  410.         wcscpy(ptr, ct);
  411.  
  412.         return s;
  413.     }
  414.  
  415.     int wcscmp(wchar_t *cs, wchar_t *ct)
  416.     {
  417.         while (*cs == *ct && *cs && *ct)
  418.         {
  419.             cs++;
  420.             ct++;
  421.         }
  422.  
  423.         return (*cs == *ct ? 0 : (*cs < *ct ? -1 : 1));
  424.     }
  425.  
  426.     int wcsncmp(wchar_t *cs, wchar_t *ct, int n)
  427.     {
  428.         while (*cs == *ct && *cs && *ct && n-- > 0)
  429.         {
  430.             cs++;
  431.             ct++;
  432.         }
  433.  
  434.         return (n <= 0 || *cs == *ct ? 0 : (*cs < *ct ? -1 : 1));
  435.     }
  436. #elif WIN32_FILE_SYSTEM
  437. #include <direct.h>
  438.     int SystemMkdir(char *dirname)
  439.     {
  440.         return mkdir(dirname);
  441.     }
  442. #endif
  443.  
  444. #ifdef __OS2__
  445. // changes for OS/2 from John Price, jgprice@ozemail.com.au, 2/99
  446. #include <direct.h>
  447.     int SystemMkdir(char *dirname)
  448.     {
  449.         return mkdir(dirname);
  450.     }
  451. #endif
  452.  
  453. #ifdef UNIX
  454.     char PathSeparator() { return U_COLON; } // ":"
  455.  
  456.     int SystemMkdir(char *dirname)
  457.     {
  458. #ifdef EBCDIC
  459.         // must translate dirname to EBCDIC before mkdir call
  460.         int n = strlen(dirname) + 1;
  461.         char *ebcdic_name = new char[n];
  462.  
  463.         for (int i = 0; i <= n; i++)
  464.              ebcdic_name[i] = dirname[i];
  465.         int rc = mkdir(ebcdic_name, S_IRWXU | S_IRWXG | S_IRWXO);
  466.         delete[] ebcdic_name;
  467.         return rc;
  468. #else
  469.         return mkdir(dirname, S_IRWXU | S_IRWXG | S_IRWXO);
  470. #endif
  471.     }
  472. #else
  473.     char PathSeparator() { return U_SEMICOLON; } // ";"
  474. #endif
  475.  
  476. Ostream Coutput;
  477.